import { BroadCastCall } from "../../../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../../../Framework/MQ/MessageBlock";
import { SPlayerPetArena } from "../../../../../../Message/Game/SPlayerPetArena";
import { MsgManager } from "../../../../manager/MsgManager";
import { Language } from "../../../../../../extend/language/Language";
import { NetDispatcher } from "../../../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../../../mvc/ServerCommand";
//class PetCpnPlayerCommand
    
    export  class PetCpnPlayerCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            var loc2=0;
            super.call(arg1);
            var loc1=arg1.messageBase as SPlayerPetArena;
            if (_cache.petCompetition.petArena) 
            {
                loc2 = loc1.totalCount - _cache.petCompetition.petArena.totalCount;
                if (loc2 > 0) 
                {
                    MsgManager.addTipText(Language.getStringByParam(54806, loc2));
                }
            }
            _cache.petCompetition.petArena = loc1;
            NetDispatcher.dispatchCmd(ServerCommand.PetCpnPlayerCommand, loc1);
            return;
        }
    }
